package com.qst.service.impl;

import com.qst.dao.QustionMapper;
import com.qst.po.ClassQuestion;
import com.qst.po.Qustion;
import com.qst.service.IQustionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class QustionServiceImpl implements IQustionService {
    @Autowired
    private QustionMapper qustionMapper;
    @Override
    public int getqustotalcount() {
        return qustionMapper.getqustotalcount();
    }

    @Override
    public List<Qustion> getqusbypage(int page, int limit) {
        return qustionMapper.getqusbypage((page-1)*limit,limit);
    }

    @Override
    public int addqus(Qustion qustion) {
        return qustionMapper.addqus(qustion);
    }

    @Override
    public Qustion getQusbyid(int id) {
        return qustionMapper.getQusbyid(id);
    }

    @Override
    public int updatequs(Qustion qustion) {
        return qustionMapper.updatequs(qustion);
    }

    @Override
    public int delqus(int id) {
        return qustionMapper.delqus(id);
    }

    @Override
    public List<Qustion> getqusall() {
        return qustionMapper.getqusall();
    }

    @Override
    public int addClassQuestion(ClassQuestion classQuestion) {
        return qustionMapper.addClassQuestion(classQuestion);
    }

    @Override
    public int getclassqustotalcount(int cid) {
        return qustionMapper.getclassqustotalcount(cid);
    }

    @Override
    public List<Qustion> getclassqusbypage(int cid, int page, int limit) {
        return qustionMapper.getclassqusbypage(cid,(page-1)*limit,limit);
    }
}
